const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {

    userNickname:"",
    boardId:"",
    userMessages:"",
    reply:"",
    createTime5:"",
    updateTime5:""


    
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (e) {
    var that = this;
    
    var that = this
    //页面初始化，option为页面跳转所带来的参数
    //let openid = wx.getStorageSync("openid");
    //var openid = options.openid
    //console.log("openid", openid)
    wx.request({
      url: app.globalData.baseUrl +'/board/getboardbyboardid',
      method: 'GET',
      data: { "boardId":  e.boardId },//传入的参数
      success: function (res) {
        var list = res.data.boardList;

        console.log("list", list)
        if (list == null) {
          var toastText = '获取数据失败' + res.data.errMsg;
          wx.showToast({
            title: toastText,
            icon: '',
            duration: 2000
          });
        } else {
          that.setData({
            boardList: list
          });
        }
      }
    })


    that.setData({
      /*userNickname: e.userNickname,
      boardId: e.boardId,
      userMessages: e.userMessages,
      reply: e.reply,
      createTime5: e.createTime5,
      updateTime5: e.updateTime5*/
    });

    console.log(e.boardId )
    
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
    
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    
  }
})